import java.io.IOException;

/**
 * @ClassName LagouServlet
 * @Deseription TODO
 * @Author fx
 * @Date 2021/1/10 0010 17:09
 * @Version 1.0
 **/
public class LagouServlet extends HttpServlet{

    @Override
    public void doGet(Request request, Response response) {
        String content = "<h1>LagouServlet get</h1>";
        try {
            response.output(HttpProtocolUtil.getHead200(content.getBytes().length)+ content);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void doPost(Request request, Response response) {
        String content = "<h1>LagouServlet post</h1>";
        try {
            response.outputHtml(HttpProtocolUtil.getHead200(content.getBytes().length)+ content);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void init() throws Exception {

    }

    @Override
    public void destory() throws Exception {

    }
}
